<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQiiPublishingRuleTable extends Migration
{
    /**
     * Schema table name to migrate
     * @var string
     */
    public $set_schema_table = 'qii_publishing_rule';

    /**
     * Run the migrations.
     * @table qii_publishing_rule
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable($this->set_schema_table)) return;
        Schema::create($this->set_schema_table, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id')->comment('远程服务器ID');
            $table->string('name')->default('')->comment('名称');
            $table->string('router')->default('')->comment('路由规则');
            $table->unsignedInteger('expire')->default('0')->comment('静态有效时间(0为永久静态化)');
            $table->unsignedTinyInteger('status')->default('1')->comment('状态 (0暂停,1正常)');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
     public function down()
     {
       Schema::dropIfExists($this->set_schema_table);
     }
}
